﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

/*
 *desc:列表实体
     */
namespace WF_ExportTool.Configuration.Grid
{

  
    /// <summary>
    /// 列表主体实体
    /// </summary>
    public class Grid_Main: BaseEntity
    {
        /// <summary>
        /// 主键
        /// </summary>
        public int GridId { get; set; }
        /// <summary>
        /// 列表编码
        /// </summary>
        public string GridCode { get; set; }
        public int AutoIndex { get; set; }
        /// <summary>
        /// 列表名称
        /// </summary>
        public string GridTitle { get; set; }
        /// <summary>
        /// 所属子系统
        /// </summary>
        public int SysId { get; set; }
        /// <summary>
        /// 所属业务功能
        /// </summary>
        public string FuncTitle { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int GridType { get; set; }
        /// <summary>
        /// 数据库链接实例
        /// </summary>
        public string DbIns { get; set; }
        /// <summary>
        /// 数据源类型
        /// </summary>
        public int DataSourceType { get; set; }
        /// <summary>
        /// 数据源
        /// </summary>
        public string DataSource { get; set; }
        /// <summary>
        /// 主表表名
        /// </summary>
        public string MainTableName { get; set; }
        /// <summary>
        /// 主键字段，多个用,分隔
        /// </summary>
        public string PKFieldName { get; set; }
        public int PKValueType { get; set; }
        /// <summary>
        /// 删除数据sql,为空则根据主键删除,获取选中数据主主键值使用关键字{@PKValues@}
        /// </summary>
        public string DelDataSql { get; set; }
        /// <summary>
        /// 默认排序，多个用,分隔
        /// </summary>
        public string DataOrder { get; set; }
        /// <summary>
        /// 是否分页
        /// </summary>
        public Boolean IsPage { get; set; }
        /// <summary>
        /// 每页显示条数
        /// </summary>
        public int PageSize { get; set; }
        /// <summary>
        /// 默认是否分组显示
        /// </summary>
        public Boolean IsGroup { get; set; }
        /// <summary>
        /// 默认分组字段，多个使用,分隔
        /// </summary>
        public string GroupField { get; set; }
        /// <summary>
        /// 分组描述
        /// </summary>
        public string GroupAlias { get; set; }
        /// <summary>
        /// 默认分组排序方式
        /// </summary>
        public int GroupSort { get; set; }
        /// <summary>
        /// 是否显示自定义分组区域
        /// </summary>
        public Boolean IsShowGroupArea { get; set; }
        /// <summary>
        /// 锁定列的数量，从左开始算起
        /// </summary>
        public int LockColumnCount { get; set; }
        /// <summary>
        /// 默认是否加载数据
        /// </summary>
        public Boolean IsLoadData { get; set; }
        /// <summary>
        /// 是否缓存
        /// </summary>
        public Boolean IsCache { get; set; }
        /// <summary>
        /// 是否缓存联系用户
        /// </summary>
        public Boolean IsCacheRelateUser { get; set; }
        /// <summary>
        /// 扩展脚本
        /// </summary>
        public string JsEx { get; set; }
        /// <summary>
        /// 扩展样式
        /// </summary>
        public string CSSEx { get; set; }
        /// <summary>
        /// 查询功能展现模式
        /// </summary>
        public int SearchModel { get; set; }
        public int DataSumType { get; set; }
        public int DataTimeSumType { get; set; }
        public string DataTimeSumField { get; set; }
        /// <summary>
        /// 列表加载前或加载后扩展类库,多个用;号分隔
        /// </summary>
        public string BeforeGridLoad { get; set; }
    }

    /// <summary>
    /// 列表字段实体
    /// </summary>
    public class Grid_Column : BaseEntity
    {
        /// <summary>
        /// 主键
        /// </summary>
        public int ColumnId { get; set; }
        /// <summary>
        /// 列表主体主键
        /// </summary>
        public int GridId { get; set; }
        /// <summary>
        /// 列名称
        /// </summary>
        public string ColumnTitle { get; set; }
        /// <summary>
        /// 第一级复杂表头标题
        /// </summary>
        public string ColumnTitleGroup1 { get; set; }
        /// <summary>
        /// 第二级复杂表头标题
        /// </summary>
        public string ColumnTitleGroup2 { get; set; }
        /// <summary>
        /// 对应数据库字段
        /// </summary>
        public string FieldName { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string FieldValueName { get; set; }
        /// <summary>
        /// 列类型
        /// </summary>
        public int ColumnType { get; set; }
        /// <summary>
        /// 是否显示
        /// </summary>
        public Boolean IsShow { get; set; }
        /// <summary>
        /// 显示顺序
        /// </summary>
        public int ShowOrder { get; set; }
        /// <summary>
        /// 显示宽度
        /// </summary>
        public int ShowWidth { get; set; }
        /// <summary>
        /// 最多显示字符数，0表示不限制
        /// </summary>
        public int MaxString { get; set; }
        /// <summary>
        /// 当列类型为模板列时，配置模板html
        /// </summary>
        public string TemplateContent { get; set; }
        /// <summary>
        /// 是否可以排序
        /// </summary>
        public Boolean IsCanOrder { get; set; }
        public Boolean IsMergeRow { get; set; }
        /// <summary>
        /// 对齐方式
        /// </summary>
        public int ShowPosition { get; set; }
        /// <summary>
        /// 时间字段类型的格式化方式
        /// </summary>
        public string TimeFormat { get; set; }
        /// <summary>
        /// 数字类型格式化方式
        /// </summary>
        public string NumberFormat { get; set; }
        /// <summary>
        /// 是否可查询
        /// </summary>
        public Boolean IsSearchShow { get; set; }
        /// <summary>
        /// 查询显示顺序
        /// </summary>
        public int SearchShowOrder { get; set; }
        /// <summary>
        /// 查询类型
        /// </summary>
        public int SearchShowType { get; set; }
        /// <summary>
        /// 当查询类型为下拉式查询或编辑类型为下拉框时，配置数据源数据库链实例
        /// </summary>
        public string FieldEnumDataIns { get; set; }
        /// <summary>
        /// 当查询类型为下拉式查询或编辑类型为下拉框时，配置数据源SQL语句，支持表达式
        /// </summary>
        public string FieldEnumDataSource { get; set; }
        /// <summary>
        /// 是否可以导出
        /// </summary>
        public Boolean IsCanExport { get; set; }
        /// <summary>
        /// 是否显示统计值
        /// </summary>
        public Boolean IsShowSum { get; set; }
        /// <summary>
        /// 字段统计方式
        /// </summary>
        public string SumType { get; set; }
        /// <summary>
        /// 当前页字段统计方式
        /// </summary>
        public string PageSumType { get; set; }
        /// <summary>
        /// 当列类型为图片超链接或文字超链接时，配置图片地址或文字(双击选择图标）
        /// </summary>
        public string ColumnIconOrText { get; set; }
        /// <summary>
        /// 当列类型为图片超链接时，配置显示颜色
        /// </summary>
        public string ColumnIconOrTextColor { get; set; }
        /// <summary>
        /// 链接列跳转方式
        /// </summary>
        public int TargetType { get; set; }
        /// <summary>
        /// 配置链接函数名或页面地址，支持表达式
        /// </summary>
        public string TargetContent { get; set; }
        /// <summary>
        /// 新窗口的宽度
        /// </summary>
        public int OpenWinWidth { get; set; }
        /// <summary>
        /// 新窗口的高度
        /// </summary>
        public int OpenWinHeight { get; set; }
        /// <summary>
        /// 是否启用根据条件来判断列是否显示
        /// </summary>
        public Boolean IsUseExpressionShow { get; set; }
        /// <summary>
        /// 用来比较是否显示的原值表达式
        /// </summary>
        public string LeftExpression { get; set; }
        public int ShowMethod { get; set; }
        public string RightExpression { get; set; }
        /// <summary>
        /// 比较结果为真时，列是否显示
        /// </summary>
        public Boolean IsShowByExpression { get; set; }
        /// <summary>
        /// 编辑控件扩展事件名称
        /// </summary>
        public string EventName { get; set; }
        /// <summary>
        /// 事件执行的方法
        /// </summary>
        public string EventMethod { get; set; }
    }

    /// <summary>
    /// 功能信息
    /// </summary>
    public class Grid_Func : BaseEntity {
        public int FuncId { get; set; }
        public int GridId { get; set; }
        public string FuncTitle { get; set; }
        public int FuncOrder { get; set; }
        public string FuncIcon { get; set; }
        public int FuncType { get; set; }
        public string FuncContext { get; set; }
        public int OpenWinWidth { get; set; }
        public int OpenWinHeight { get; set; }
        public string FuncOpenWinTitle { get; set; }
        public Boolean IsUseExpressionShow { get; set; }
        public string LeftExpression { get; set; }
        public int ShowMethod { get; set; }
        public string RightExpression { get; set; }
        public Boolean IsShowByExpression { get; set; }

    }



}
